// 返回数据格式化中间件
const responseHandler = (req, res, next)=> {
    res.createResponse = (code = 200, message = '成功', data = {}) => {
        res.json({ code, message, data });
        // res.status(status).json({ code, message, data });
    };
    next();
}

module.exports = responseHandler;